Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

London-8-Maryam-Mohsenpour-JavaScript-core-1-coursework-week1 - #257

Closed
bita2019 wants to merge 4 commits into
CodeYourFuture:masterfrom
bita2019:master
Closed

London-8-Maryam-Mohsenpour-JavaScript-core-1-coursework-week1#257
bita2019 wants to merge 4 commits into
CodeYourFuture:masterfrom
bita2019:master

Conversation

@bita2019

Copy link
Copy Markdown

Volunteers: Are you marking this coursework? You can find a guide on how to mark this coursework in HOW_TO_MARK.md in the root of this repository

Your Details

  • Your Name:
  • Your City:
  • Your Slack Name:

Homework Details

  • Module:
  • Week:

Notes

  • What did you find easy?

  • What did you find hard?

  • What do you still not understand?

  • Any other notes?

// Start by creating a variable `greeting`

console.log(greeting);
var greeting = " hello world";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space before the word 'hello' is unnecessary here. I understand that you created it in order to print out 'greeting 'three times in the console including spaces in between. Instead, to fulfil requirements of the task, it would be better to log console three times with 'hello world'.


console.log(greeting);
var greeting = " hello world";
console.log(greeting, greeting, greeting);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above.

@hachi-ops hachi-ops left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is generally good. I think in this file you have performed certain JS methods inside the console instead of actually using them in your code. Please remember that console.log is just for checking how your program runs.


console.log(message);
const myname = " Daniel ";
console.log(myname.trim());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The console will indeed display 'Daniel' with no white spaces around but it will only be shown in the console not in your program. Instead you could use trim() method on the variable within your code and then console.log would show already trimmed message in the output.

// Start by creating a variables `numberOfStudents` and `numberOfMentors`
let numberOfStudents = 15;
let numberOfMentors = 8;
let subtotal = numberOfStudents + numberOfMentors;

@hachi-ops hachi-ops Dec 17, 2021

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it would be better to call it 'total' instead but it is not a big deal anyway:) the name 'subtotal' suggests here that you intend to add something to it.

let numberOfStudents = 15;
let numberOfMentors = 8;
let subtotal = numberOfStudents + numberOfMentors;
let mentorpercent = (numberOfMentors * 100) / subtotal;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The math is good here.

let numberOfMentors = 8;
let subtotal = numberOfStudents + numberOfMentors;
let mentorpercent = (numberOfMentors * 100) / subtotal;
let studentpercent = (numberOfStudents * 100) / subtotal;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above

let mentorpercent = (numberOfMentors * 100) / subtotal;
let studentpercent = (numberOfStudents * 100) / subtotal;
console.log("percentage of students is :", Math.round(studentpercent));
console.log("percentage of mentors is :", Math.round(mentorpercent));

@hachi-ops hachi-ops Dec 17, 2021

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again , I think to fulfil the requirements of the task you should have used Math.round() method within your program (on variables) instead of in the console.log

let mentorname = text.UpperCase();
return mentorname;
}
console.log(makeuppercase(mentor1));

@hachi-ops hachi-ops Dec 17, 2021

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is very good. You have correctly transformed your variable to uppercase within your code and then displayed the function containing it in the console to check the output of your program.

@DiegoJunior0

Copy link
Copy Markdown

Hi Maryam, this is good work, you're just missing the mandatory test 4: 4-tax.js.

@bita2019

bita2019 commented Jan 5, 2022 via email

Copy link
Copy Markdown
Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants